/**
 * Created by jack on 18/3/31.
 */

class MirrorTree {
    public boolean isSymmetric(TreeNode root) {
        return isMorror(root,root);
    }

    private boolean isMorror(TreeNode t1,TreeNode t2){
        if(t1 == null && t2 == null){
            return true;
        }
        if(t1 == null || t2 == null){
            return false;
        }
        return (t1.val == t1.val) && isMorror(t1.left,t1.right) && isMorror(t1.right,t2.left);
    }
}